package com.example.vote.flow.pojo.param;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serializable;

@Data
@Schema(description = "用户登录参数Class")
public class UserLoginParam implements Serializable {

    @Schema(description = "用户名", example = "zhangsan", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{4,16}$", message = "用户名格式不正确")
    private String username;

    @Schema(description = "密码", example = "1234", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{4,16}$", message = "密码格式不正确")
    private String password;

}
